public class Student {
    private String name;
    private int age;

    private String id;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) throws RuntimeException{
        if(age <0 || age >120) {
            throw new RuntimeException("年龄不合理");
        }
        this.age = age;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Student() {
    }

    public void eat() {
        System.out.println(this.name + "正在吃饭");
    }

    public void study() {
        System.out.println(this.name + "正在学习");
    }
}
